<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=">
<title>添加礼物</title>
<link rel="stylesheet" href="__PUBLIC__/Admin/css/css.css">
<script src="__PUBLIC__/Admin/js/jquery-1.9.1.js"></script>
<script src="__PUBLIC__/Common/Layer/layer.js"></script>
<script>
$(function() {
  $("#button").click(function() {
    var news = $("#news_info").val();
    if(news == ""){
      layer.tips('请输入消息', '#news_info');
      return false;
    }
    $.ajax({
      data:"news_info="+news,
      type:"POST",
      url:"{:U('Article/news_add')}",
      success:function(msg) {
        if(msg == 1){
        parent.layer.msg('操作成功', { icon: 1, time: 1000 },function(){
            window.parent.iframe.location.href = "{:U('Article/news_list')}";
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index); //再执行关闭
          });
        }else{
          parent.layer.msg('操作失败', {icon: 2, time: 2000 }); 
        }
      }
    });
  });
});
</script>
</head>
<body>
<form action="__SELF__" id="formid" method="post" class="update_pwd" enctype="multipart/form-data">
  <div align="list">
  <table border="0" cellpadding="0" cellspacing="0" class="details" style="padding-left:20px">
    <tr>
      <td><div align="right">消息内容：</div></td>
      <td><textarea name="news_info" id="news_info" cols="40" rows="7" style="line-height:2;letter-spacing:1px"></textarea></td>
    </tr>
  </table>
  </div>
<div class="footer">
  <button type="button" class="button" id="button" style="min-width:160px;">确 认</button>
</div>
</form>
</body>
</html>
